<?php

namespace App\Repositories;

use App\Models\Access;
use App\Exceptions\InvalidException;
class AccessRepo extends  BaseRepo
{
    public function getAccessList($where=[],$page=15)
    {
        return Access::where(function($query) use ($where){

        })->paginate($page)->toArray();
    }

    public function addAccess($data)
    {
        try{
            Access::create($data);
        }catch(\Exception $e) {
            throw new InvalidException($e->getMessage());
        }
    }
    public function getAll()
    {

         return  Access::all()->toArray();

    }
}
